home *** CD-ROM | disk | FTP | other *** search
/ 600 Games / 600games.iso / Nave / monochrome.swf / scripts / frame_10 / PlaceObject2_463_321 / CLIPACTIONRECORD onClipEvent(enterFrame).as next >
Encoding:
Text File  |  2005-08-26  |  2.0 KB  |  85 lines

  1. onClipEvent(enterFrame){
  2.    if(_currentframe == 1)
  3.    {
  4.       if(_name != "shipORLON")
  5.       {
  6.          xspeed = speed * Math.sin((_rotation * -1 + 180) * 0.017453292519943295);
  7.          yspeed = speed * Math.cos((_rotation * -1 + 180) * 0.017453292519943295);
  8.          _X = _X + xspeed;
  9.          _Y = _Y + yspeed;
  10.          xx = random(120);
  11.          if(xx == 0)
  12.          {
  13.             speed = 17;
  14.             timer = 70;
  15.          }
  16.          timer -= 1;
  17.          if(timer == 0)
  18.          {
  19.             speed = 8;
  20.          }
  21.          var i = 0;
  22.          while(i <= 20)
  23.          {
  24.             if(sh.harea.hitTest(_root["hmn" + i]))
  25.             {
  26.                life -= _root["hmn" + i].dmg;
  27.                sh.play();
  28.                removeMovieClip(_root["hmn" + i]);
  29.                rr = random(5);
  30.                if(rr == 0 && started)
  31.                {
  32.                   _rotation = random(360);
  33.                }
  34.             }
  35.             i++;
  36.          }
  37.          if(_root.ship.sh.hitTest(sh.harea))
  38.          {
  39.             _root.ship.play();
  40.          }
  41.          if(life <= 0)
  42.          {
  43.             play();
  44.          }
  45.          yy = random(40);
  46.          if(yy == 0)
  47.          {
  48.             _root.fire(this);
  49.          }
  50.          if(started)
  51.          {
  52.             if(_X < rad)
  53.             {
  54.                _rotation = -1 * _rotation;
  55.                _X = rad;
  56.             }
  57.             if(_X > 550 - rad)
  58.             {
  59.                _rotation = -1 * _rotation;
  60.                _X = 550 - rad;
  61.             }
  62.             if(_Y > 400 - rad)
  63.             {
  64.                _rotation = -1 * _rotation + 180;
  65.                _Y = 400 - rad;
  66.             }
  67.             if(_Y < rad)
  68.             {
  69.                _rotation = -1 * _rotation + 180;
  70.                _Y = rad;
  71.             }
  72.          }
  73.          if(_Y > rad * 2 && !started)
  74.          {
  75.             started = true;
  76.             speed = 8;
  77.          }
  78.       }
  79.       if(_root.rem == true)
  80.       {
  81.          removeMovieClip(this);
  82.       }
  83.    }
  84. }
  85.